<?php



function recupererClassement(){

	$res = array();

	$s =& load("sql");
	$s->select("*", "groupes", "", "ORDER BY grp_nom ASC");

	while($r = $s->fetch_object()){
		if ($r->grp_parent == 0) // Groupe de base
			$type = "cat";
		else
			$type= "scat";

		$res[] = array($type, "grp".$r->grp_UID, (($r->grp_parent == 0) ? "0" : "grp".$r->grp_parent), $r->grp_nom);
	}

	$s->select("*", "etiquette", "", "ORDER BY eti_nom ASC");
	while($r = $s->fetch_object())
		$res[] = array("eti", $r->eti_UID, "grp".$r->eti_group, $r->eti_nom);

	return $res;

}

function recupererGroupes(){

	$res = array();

	$s =& load("sql");
	$s->select("*", "groupes", "", "ORDER BY grp_nom ASC");

	while($r = $s->fetch_object()){
		if ($r->grp_parent == 0) // Groupe de base
			$type = "cat";
		else
			$type= "scat";

		$res[] = array($type, "grp".$r->grp_UID, (($r->grp_parent == 0) ? "0" : "grp".$r->grp_parent), $r->grp_nom);
	}

	return $res;

}

?>